package math;

public class FloatOptest {

    private static void testFloat() {
        long beforeTime = System.currentTimeMillis();
        long offset = Long.MAX_VALUE-100;//999967895333330008l;
        for (long i=offset; i<offset + 100l; i++) {
            long speed = i;
            speed *= 1.852;
            System.out.println("speed:" + speed);
        }
        System.out.println("takes:" + (System.currentTimeMillis() - beforeTime));
    }
    
    private static void testDouble() {
        double dTime = 1.2f;
        long lTime = Double.doubleToLongBits(dTime);
        System.out.println("double to long:" + Long.toHexString(lTime) );
        System.out.println("double to long:" +  Long.toHexString(Double.doubleToLongBits(2.2f)));
    }
    /**
     * @param args
     *
     * @author grind
     * @date Sep 25, 2013 9:05:53 AM
     */
    public static void main(String[] args){
        //testFloat();
        testDouble();
    }

}
